<template>
	<view>
		<view class="nav">
			<image src="../../../static/PersonalCenter/fanhui.png" mode="" class="left" @click="back"></image>
			<view class="" class="hui">开通会员</view>
		</view>
		
		<view class="yonghu">
			<image src="../../../static/PersonalCenter/touxiang.png" mode="" class="touxiang"></image>
			<view class="username">小A 123456</view>
		</view>
		<view class="putong" >
			<view class="btn">普通用户</view>
		</view>
		
		<view class="zaiwei">
			<view class="huiyuan">
				<view class="">VIP会员套餐</view>
				<image src="../../../static/PersonalCenter/record.png" mode="widthFix" style="width: 140rpx;" @click="Purchaserecords"></image>
				
			</view>
			
		</view>
		<view class="setmeal">
			
			<view class="taochan">
				<view :class="current === index ? 'baoyue':'baonian'" v-for="(item,index) in continuityList" :key ="index" @click="choice(index)">
					
					<view class="">{{item.name}}</view>
					<view class="Price">￥{{item.price}}</view>
					<view class="renew" v-if="index <= 2">{{item.type}}</view>
				    <!-- <view class="month" v-if="index > 2">{{item.time}}</view> -->
					
				</view>
				
			</view>
			
			<button type="default" class="kaitong">立即开通</button>
			<view class="daoqi">会员到期时间： 2021-09-15 22:05</view>
			
		</view>
	    <!-- 购买记录弹出层 -->
		<uni-popup ref="popup" type="bottom">
			<view class="popup">
				
				<view class="title">
					<image src="../../../static/pray/cha.png" mode="" class="cha" @click="close"></image>
					<view class="">我的购买记录</view>
				</view>
				
				<view class="consumption">
					<view class="">
						<view style="font-size: 34rpx;padding-bottom: 16rpx;">1个月</view>
						<view style="font-size: 30rpx;color: #555555;">06:50 2021-09-26</view>
					</view>
					<view class="xiaofei">-40.00</view>
				</view>
				<view class="line"></view>
			</view>
		</uni-popup>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				continuityList: [{
					name: '1年',
					price: '388',
					type: '32.4/月'
				},{
					name: '3个月',
					price: '113',
					type: '37.7/月'
				},{
					name: '1个月',
					price: '40',
					type: '40/月'
				}],
				current: 0,
			};
		},
		methods:{
			back(){
				uni.switchTab({
					url:'../user'
				})
			},
			choice(index){
				this.current = index 
			},
			Purchaserecords(){
				 this.$refs.popup.open()
			},
			close(){
				this.$refs.popup.close()
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #FFFFFF;
		
	}
	.nav {
		display: flex;
		align-items: flex-end;
		background-color: #C52B2E;
		width: 100%;
		height: 88rpx;
		padding-bottom: 30rpx;
		// position: fixed;
		// z-index: 999 !important;
		// margin-top: 65rpx;
		display: flex;
		justify-content: center;
		.left {
			width: 22rpx;
			height: 37rpx;
			position: absolute;
			left: 28rpx;
		}
		.hui {
			color: #FFFFFF;
		}
	}
	.yonghu {
		padding-top: 50rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color:#C52B2E ;
		.username {
			color: #FFFFFF;
		}
		.touxiang {
			width: 72rpx;
			height: 72rpx;
			padding-right: 15rpx;
		}
	}
	.putong {
		display: flex;
		justify-content: center;
		padding-top: 20rpx;
		// padding-bottom: 100rpx;
		background-color: #C52B2E;
		
	}
	.zaiwei {
		width: 100%;
		height: 100rpx;
		background-color: #C52B2E;
		padding-top: 50rpx;
		
	}
	.btn {
		width: 152rpx;
		height: 51rpx;
		line-height: 51rpx;
		background-color: #EEEEEE;
		text-align: center;
		border-radius: 30rpx;
	    color: #9E9D9D; 
	}
	.huiyuan {
	
		padding: 34rpx 29rpx 50rpx 29rpx;
		font-size: 33rpx;
		background-color: #FFFFFF;
		border-radius: 20rpx 20rpx 0 0 ;
	    display: flex;
		justify-content: space-between;
	
		
	}
	.setmeal {
		width: 100%;
		background-color: #FFFFFF;
		padding-top: 26rpx;
		// padding-bottom: 60rpx;
		box-sizing: border-box;
		position: absolute;
		// top: 350rpx;
		
		
		
		
		.taochan{
		    padding-bottom: 40rpx;
			display: flex;
			flex-wrap: wrap;
			justify-content: space-around;
			.baoyue {
				margin-top: 30rpx;
				width: 200rpx;
				height: 240rpx;
				background-color: #DD524D;
				box-shadow: 1px 1px 2px 2px rgba(0, 0, 0, 0.1);
				border-radius: 20rpx;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				.Price {
					padding-top: 15rpx;
					font-size: 33rpx;
					color: #C52B2E;
				}
				.unrenew {
					font-size: 21rpx;
					color: #857E7E;
					padding-top: 12rpx;
				}
				.renew {
					width: 180rpx;
					height: 50rpx;
					background-color: #F9B1B1;
					font-size: 25rpx;
					line-height: 50rpx;
					border-radius: 30rpx;
					text-align: center;
					color: #FFFFFF;
					margin-top: 20rpx;
				}
				.month {
					font-size: 21rpx;
					color: #857E7E;
					padding-top: 15rpx;
				}
			}
			.baonian {
				margin-top: 30rpx;
				width: 200rpx;
				height: 240rpx;
				background-color: #FFFFFF;
				box-shadow: 1px 1px 2px 2px rgba(0, 0, 0, 0.1);
				border-radius: 20rpx;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				.Price {
					padding-top: 15rpx;
					font-size: 33rpx;
					color: #C52B2E;
				}
				.unrenew {
					font-size: 21rpx;
					color: #857E7E;
					padding-top: 12rpx;
				}
				.renew {
					width: 180rpx;
					height: 50rpx;
					background-color: #F9B1B1;
					font-size: 25rpx;
					line-height: 50rpx;
					border-radius: 30rpx;
					text-align: center;
					color: #FFFFFF;
					margin-top: 20rpx;
				}
				.month {
					font-size: 21rpx;
					color: #857E7E;
					padding-top: 15rpx;
				}
			}
		}
		.kaitong {
			width: 710rpx;
			height: 78rpx;
			line-height: 78rpx;
			border-radius: 40rpx;
			background-color: #C52B2E;
			color: #FFFFFF;
			margin-top: 210rpx;
		}
		.daoqi {
			color: #999999;
			display: flex;
			justify-content: center;
			padding: 20rpx;
		}
		
	}
	.popup {
		width: 100%;
		height: 900rpx;
		background-color: #FFFFFF;
		border-radius: 40rpx 40rpx 0 0;
		
		.title {
			display: flex;
			justify-content: center;
			align-items: center;
			padding: 25rpx 0;
			border-bottom: 1rpx solid #EEEEEE;
			
			.cha {
				width: 34rpx;
				height: 34rpx;
				position: relative;
				right: 210rpx;
				
			
			}
		}
		.consumption {
			padding: 30rpx 40rpx;
			
			display: flex;
			justify-content: space-between;
			align-items: center;
			
			.xiaofei {
				font-size: 40rpx;
				color: #C52B2E;
			}
		}
		.line {
		    width: 95%;
			margin-left: 20rpx;
			border-bottom: 1rpx dashed #707070;
		}
		
	}
	

</style>
